package com.tianji.learning.controller;


import com.tianji.learning.domain.query.PointsBoardQuery;
import com.tianji.learning.domain.vo.PointsBoardSeasonVO;
import com.tianji.learning.domain.vo.PointsBoardVO;
import com.tianji.learning.service.IPointsBoardSeasonService;
import com.tianji.learning.service.IPointsBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author yp
 * @since 2024-07-30
 */
@RestController
@RequestMapping("/boards")
@Api(tags = "排行榜记录相关接口")
@RequiredArgsConstructor
public class PointsBoardSeasonController {
    private final IPointsBoardSeasonService pointsBoardSeasonService;
    private final IPointsBoardService boardService;

    @GetMapping("/seasons/list")
    @ApiOperation("查询所有赛季记录")
    public List<PointsBoardSeasonVO> queryBoardSession() {
        return pointsBoardSeasonService.queryBoardSession();
    }

    @GetMapping
    @ApiOperation("根据赛季查询积分排行榜")
    public PointsBoardVO queryPointBoardBySeason(PointsBoardQuery query) {
        return boardService.queryPointBoardBySesson(query);
    }


}